Skip to content

#137 - feat: add search functionality and restore selection in Hierarchy component#129

Merged
ddelpiano merged 4 commits intodevelfrom
feature/issue-137
Sep 10, 2025
Merged

#137 - feat: add search functionality and restore selection in Hierarchy component#129
ddelpiano merged 4 commits intodevelfrom
feature/issue-137

Conversation

@jrmartin
Copy link

@jrmartin jrmartin commented Sep 4, 2025

This pull request introduces significant improvements to the hierarchy tree component and its integration, focusing on enhanced search/filtering, better navigation and selection handling, and improved user experience through visual feedback and actions. The changes are mainly in Hierarchy.jsx and CustomizedTreeView.jsx, with supporting updates in related files.

Hierarchy filtering and navigation enhancements:

  • Added a new collectMatchingIds function to support filtering tree items by id, label, or IRI, enabling search highlights within the hierarchy tree.
  • Refactored selection logic in Hierarchy to remember the initial selected term, track pre-search selection, and provide "Refresh" and "Aim" buttons for restoring and focusing hierarchy states. [1] [2]
  • Integrated search term highlighting and improved tree expansion logic to ensure matched and selected nodes are visible, including auto-expansion of relevant ancestors. [1] [2]

User interface and experience improvements:

  • Enhanced tree item rendering in CustomizedTreeView: added visual chips for "Current Item" and "Match", and introduced a hover action to open leaf nodes in a new tab.
  • Updated props and slot handling to support new features, including passing highlighted IDs and metadata for improved rendering and interaction. [1] [2]

Bug fix:

  • Fixed a loading state bug in predicate fetching by ensuring setLoadingPredicates(false) is called on error in OverView.jsx.

@jrmartin jrmartin requested a review from Copilot September 4, 2025 04:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds search functionality and selection restoration to the Hierarchy component by implementing term highlighting and visual feedback in the tree view. The changes enable users to search for terms within the hierarchy tree and restore their previous selection state.

Key changes:

  • Added search highlighting functionality with visual match indicators
  • Implemented selection state restoration before/after search operations
  • Enhanced tree view with hover actions for leaf nodes to open terms in new tabs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
CustomizedTreeView.jsx Enhanced tree component with search highlighting, hover actions, and improved expansion logic
OverView.jsx Fixed error handling to properly reset loading state when predicate fetching fails
Hierarchy.jsx Added search functionality, selection restoration, and improved button behaviors

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jrmartin jrmartin marked this pull request as ready for review September 5, 2025 12:38
@jrmartin jrmartin requested a review from ddelpiano September 5, 2025 12:39
@ddelpiano ddelpiano merged commit f9314ee into devel Sep 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants